package com.jzbooks.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author mingPeng
 * @date 2021/5/3 23:05
 * @Description : 借阅表实体
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("借阅表实体")
@TableName("borrowing")
public class Borrowing extends BaseEntity{

    @ApiModelProperty("借阅日期")
    @TableField(value = "borrowing_date")
    private Date borrowingData;

    @ApiModelProperty("应还日期")
    @TableField(value = "should_return_date")
    private String shouldReturnDate;

    @ApiModelProperty("还书日期")
    @TableField(value = "return_date")
    private String returnData;

    @ApiModelProperty("状态码,0待取书,1已借阅,2按时归还,3超时归还,4未还")
    @TableField(value = "state")
    private Byte state;

    @ApiModelProperty("借阅用户id")
    @TableField(value = "user_id")
    private Integer userId;

    @ApiModelProperty("借阅书籍id")
    @TableField(value = "book_id")
    private Integer bookId;

    @ApiModelProperty("逻辑删除")
    @TableField(value = "deleted")
    @TableLogic
    private Integer deleted;

    public static final String COL_BORROWING_DATE = "borrowing_date";

    public static final String COL_SHOULD_RETURN_DATE = "should_return_date";

    public static final String COL_RETURN_DATE = "return_date";

    public static final String COL_STATE = "state";

    public static final String COL_USER_ID = "user_id";

    public static final String COL_BOOK_ID = "book_id";

    public static final String COL_DELETED = "deleted";


}
